//Piece helper class
#include "globals.h"

class Piece{
public:
	Piece(int, int, int = 0, int = 0);
	
	void setTeam(int);
	int getTeam();
	
	void setType(int);
	int getType();
	
	int getID();
	void setID(int);
	
	void moveTo(int, int);
	int x();
	int y();

	int attack(int);	
private:
	int team, type, id;
	int pos[2];
};
Piece::Piece(int tp, int tm, int xpos, int ypos){
	team = tm;
	type = tp;
	pos[0] = xpos;
	pos[1] = ypos;
}
void Piece::setTeam(int tm){
	team = tm;
}
int Piece::getTeam(){
	return team;
}
int Piece::getID(){
	return id;
}
void Piece::setID(int i){
	id = i;
}
void Piece::setType(int tp){
	type = tp;
}
int Piece::getType(){
	return type;
}
void Piece::moveTo(int xpos, int ypos){
	pos[0] = (float) xpos;
	pos[1] = (float) ypos;
}
int Piece::x(){
	return pos[0];
}
int Piece::y(){
	return pos[1];
}
int Piece::attack(int opponent){
	int wins = defeat_types[type][opponent];
	return wins;
}
	

